<?php

namespace App\Http\Controllers\Admin\Module;

use App\Model\Repair;
use App\Repository\RepairRepository;
use Illuminate\Http\Request;
use App\Http\Controllers\Controller;

class RepairController extends Controller
{

    /**
     * @var RepairRepository
     */
    private $repair;

    /**
     * RepairController constructor.
     * @param RepairRepository $repair
     */
    public function __construct(RepairRepository $repair)
    {
        $this->middleware('permission:repair_manage');
        $this->repair = $repair;
    }

    /**
     * Display a listing of the resource.
     *
     * @param Request $request
     * @return \Illuminate\Http\Response
     */
    public function index(Request $request)
    {
        $repairs = $this->repair->search($request->all());

        $repairers = $this->repair->getRepairers();

        $statuses = Repair::$statusArray;

        return view('admin.module.repair.index', compact('repairs', 'repairers', 'statuses'));
    }

    /**
     * Show the form for creating a new resource.
     *
     * @return \Illuminate\Http\Response
     */
    public function create()
    {
        //
    }

    /**
     * Store a newly created resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @return \Illuminate\Http\Response
     */
    public function store(Request $request)
    {
        //
    }

    /**
     * Display the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function show($id)
    {
        //
    }

    /**
     * Show the form for editing the specified resource.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function edit($id)
    {
        //
    }

    /**
     * Update the specified resource in storage.
     *
     * @param  \Illuminate\Http\Request  $request
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function update(Request $request, $id)
    {
        //
    }

    /**
     * Remove the specified resource from storage.
     *
     * @param  int  $id
     * @return \Illuminate\Http\Response
     */
    public function destroy($id)
    {
        //
    }
}
